Updating PHP on Windows
This guide walks through the process of updating the PHP version on a Windows server running DreamFactory. Follow these steps carefully to ensure a smooth upgrade process.
Prerequisites
Before beginning the update process ensure you have backed up:
- Your existing PHP folder
- Your system database
- A copy of your
.env
file
Installation Steps
1. Download PHP
- Visit the official PHP for Windows website
- Download the Non-Thread-Safe (NTS) version for your architecture (x64 or x86)
- Example:
php-8.2.25-nts-Win32-vs16-x64.zip
- Example:
Important
Always use the Non-Thread-Safe (NTS) version of PHP with DreamFactory on Windows.
2. Install PHP
- Create a new directory:
C:\PHP\php-X.X.X
(replace X.X.X with version number) - Extract the downloaded ZIP contents to this directory
- Create a symlink from
C:\php
to your version-specific directory (optional, but recommended for easier management)
3. Configure Environment Variables
- Open System Properties:
Win + R → sysdm.cpl → Enter
- Navigate to: Advanced tab → Environment Variables
- Under System Variables:
- Edit
Path
- Add new PHP directory path (e.g.,
C:\PHP\php
) - Remove old PHP path if present
- Edit
- Verify installation:
php -v
4. Configure PHP
-
Configure
php.ini
:- If you are on the same major versio nof PHP you can copy your existing
php.ini
from the previous installation, OR - Create new from
php.ini-production
:copy php.ini-production php.ini
- If you are on the same major versio nof PHP you can copy your existing
-
Enable required extensions in
php.ini
:- See PHP Extensions Guide for the complete list
- Ensure SQL Server extensions are properly configured if using SQL Server
5. Configure IIS
-
Open IIS Manager
-
Access PHP Manager:
- Register new PHP version:
C:\php\php-cgi.exe
- Verify extensions are enabled
- Check PHP configuration status
- Register new PHP version:
-
Restart Services:
iisreset
6. Verify Installation
-
Check PHP configuration:
- Use PHP Manager's "Check phpinfo()"
- Verify PHP version
- Confirm required extensions are loaded
-
Test DreamFactory:
- Access your DreamFactory instance
- Check the System Information page
- Verify all services are functioning
Troubleshooting
If you encounter issues:
-
Check PHP Version:
- Ensure you're using NTS version
- Verify architecture matches (x64/x86)
-
Verify Extensions:
- Review required extensions
- Check extension paths in
php.ini
-
Review Logs:
- Check PHP error logs
- Review IIS logs
- Examine DreamFactory logs
For additional help, see our Troubleshooting Guide or contact DreamFactory Support.